feat: added document filtering during export depending on shareability status#73
Open
feat: added document filtering during export depending on shareability status#73
Conversation
b41ex
requested changes
Mar 27, 2026
b41ex
requested changes
Mar 30, 2026
|
|
||
| buildResult.exportFileName = createSingleFileExportName(packageId, version, getDocumentTitle(buildResult.exportDocuments[0].filename), format) | ||
| const singleExportDocument = buildResult.exportDocuments[0] | ||
| const singleExportDocumentExtension = isSingleNonRestDocument |
Collaborator
There was a problem hiding this comment.
Can we add tests to this logic?
I.e. that the output is either zip archive or single file depending on number of documents to be exported (and format?).
makeev-pavel
approved these changes
Mar 30, 2026
JayLim2
reviewed
Mar 30, 2026
|
|
||
| const documentsToExport = filterDocumentsByShareabilityStatus(documents, config) | ||
|
|
||
| const isSingleNonRestDocument = documentsToExport.length === 1 && !isRestDocument(documentsToExport[0]) |
Collaborator
There was a problem hiding this comment.
this flag used once, move it to line 63
| const { createExportDocument } = apiBuilders.find(({ types }) => types.includes(document.type)) || unknownApiBuilder | ||
| const file = await rawDocumentResolver(versionWithRevision, packageId, document.slug) | ||
| return await createExportDocument?.(file.name, await file.text(), format, packageName, version, templateResolver, allowedOasExtensions) ?? createUnknownExportDocument(file.name, file) | ||
| })) |
Collaborator
There was a problem hiding this comment.
callback on lines 97-101 and 130-134 seems the same
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.